export function debounce (fun,time=500) {
  let t = null;

  return (e) => {
    clearTimeout(t);
    t = setTimeout(() => {
      fun.call(this,e)
    }, time);
  }
}